-- @owner: @wan005
-- @date: 2022/2/10
-- @testpoint: 创建ustore表,结合序列插入数据

--step1:建表;  expect:成功
drop table if exists t_condition_sink_001;
create table t_condition_sink_001(col_1 integer,col_2 bigint constraint cons1_t_sink primary key,col_3 float8,col_4 decimal(12,6),col_5 bool,col_6 char(30),col_7 varchar2(50),col_8 varchar(30),col_9 interval day to second,col_10 timestamp,col_11 date,col_12 smalldatetime,col_13 timestamp without time zone,col_14 blob,col_15 clob,col_16 int[]) with (storage_type=ustore);

--step2:创建序列   expect:成功
drop sequence if exists s_condition_sink_seq;
create sequence s_condition_sink_seq increment by 1 start with 10;

--step3:插入数据,部分字段值引用序列   expect:成功
insert into t_condition_sink_001 values(1,s_condition_sink_seq.nextval, 1+445.255,98*0.99,  true,lpad('abc','6','@'),lpad('abc','5','b'),rpad('abc','6','e'),(interval '4 5:12:10.222' day to second(3)),to_timestamp('2019-01-03 14:58:54.000000','yyyy-mm-dd hh24:mi:ss.ffffff'),    to_timestamp('12-sep-10 14:10:10.123000','dd-mon-yy hh24:mi:ss.ff'),to_timestamp('12-sep-10 14:10:10.123000','dd-mon-yy hh24:mi:ss.ff'),to_timestamp('12-sep-10 14:10:10.123000','dd-mon-yy hh24:mi:ss.ff'),lpad('10','12','01010')::blob,rpad('abc','9','a@123&^%djgk'),'{32,535,5645645,6767,76,67,56,48,979,978,7}');
insert into t_condition_sink_001 values(1,s_condition_sink_seq.nextval+10,1+445.255,98*0.99,  true,lpad('abc','6','@'),lpad('abc','6','b'),rpad('abc','5','e'),(interval '4 5:12:10.222' day to second(3)),to_timestamp('2019-01-03 14:58:54.000000','yyyy-mm-dd hh24:mi:ss.ffffff'),  to_timestamp('12-sep-10 14:10:10.123000','dd-mon-yy hh24:mi:ss.ff'),to_timestamp('12-sep-10 14:10:10.123000','dd-mon-yy hh24:mi:ss.ff'),to_timestamp('12-sep-10 14:10:10.123000','dd-mon-yy hh24:mi:ss.ff'),lpad('10','12','01010')::blob ,rpad('abc','9','a@123&^%djgk'),'{32,535,5645645,6767,76,67,56,48,979,978,7}');
insert into t_condition_sink_001 values(2,s_condition_sink_seq.nextval, 1+445.255,98*0.99, false,lpad('abc','6','@'),lpad('abc','5','b'),rpad('abc','5','e'),(interval '4 5:12:10.222' day to second(3)),to_timestamp('2019-01-03 14:58:54.000000','yyyy-mm-dd hh24:mi:ss.ffffff'), to_timestamp('12-sep-10 14:10:10.123000','dd-mon-yy hh24:mi:ss.ff'),to_timestamp('12-sep-10 14:10:10.123000','dd-mon-yy hh24:mi:ss.ff'),to_timestamp('12-sep-10 14:10:10.123000','dd-mon-yy hh24:mi:ss.ff'),lpad('10','12','01010')::blob  ,rpad('abc','9','a@123&^%djgk'),'{43,535,5645645,6767,76,67,56,48,979,978,7}');
insert into t_condition_sink_001 values(3,s_condition_sink_seq.nextval, 1+445.255,98*0.99, false,lpad('abc','4','@'),lpad('abc','4','b'),rpad('abc','6','e'),(interval '4 5:12:10.222' day to second(3)),to_timestamp('2019-01-03 14:58:54.000000','yyyy-mm-dd hh24:mi:ss.ffffff'),  to_timestamp('12-sep-10 14:10:10.123000','dd-mon-yy hh24:mi:ss.ff'),to_timestamp('12-sep-10 14:10:10.123000','dd-mon-yy hh24:mi:ss.ff'),to_timestamp('12-sep-10 14:10:10.123000','dd-mon-yy hh24:mi:ss.ff'),lpad('10','12','01010')::blob ,rpad('abc','9','a@123&^%djgk'),'{32,535,5645645,6767,76,67,56,48,979,978,7}');
insert into t_condition_sink_001 values(4,s_condition_sink_seq.nextval, 1+445.255,98*0.99, false,lpad('abc','3','@'),lpad('abc','3','b'),rpad('abc','3','e'),(interval '4 5:07:10.222' day to second(3)),to_timestamp('2019-01-03 14:58:54.000000','yyyy-mm-dd hh24:mi:ss.ffffff'),  to_timestamp('12-sep-10 14:10:10.123000','dd-mon-yy hh24:mi:ss.ff'),to_timestamp('12-sep-10 14:10:10.123000','dd-mon-yy hh24:mi:ss.ff'),to_timestamp('12-sep-10 14:10:10.123000','dd-mon-yy hh24:mi:ss.ff'),lpad('10','12','01010')::blob ,rpad('abc','9','a@123&^%djgk'),'{32,535,5645645,6767,76,67,56,48,979,978,7}');
insert into t_condition_sink_001 values(5,s_condition_sink_seq.nextval, 1+445.255,98*0.99,  true,lpad('abc','3','@'),lpad('abc','4','b'),rpad('abc','6','e'),(interval '4 5:07:10.222' day to second(3)),to_timestamp('2019-01-03 14:58:54.000000','yyyy-mm-dd hh24:mi:ss.ffffff'),  to_timestamp('12-sep-10 14:10:10.123000','dd-mon-yy hh24:mi:ss.ff'),to_timestamp('12-sep-10 14:10:10.123000','dd-mon-yy hh24:mi:ss.ff'),to_timestamp('12-sep-10 14:10:10.123000','dd-mon-yy hh24:mi:ss.ff'),lpad('10','12','01010')::blob ,rpad('abc','9','a@123&^%djgk'),'{43,535,5645645,6767,76,67,56,48,979,978,7}');

--step4:环境清理   expect:成功
drop table t_condition_sink_001 cascade;
drop sequence s_condition_sink_seq;
